<template>
  <div>
    用户名<input type="text" v-model='form.username'>
    密码<input type="text" v-model='form.password'>
    <button @click='login'>登录</button>

  </div>
</template>
<script>
export default {
  name: "denglu",
  data(){
    return{
      form:{}
    }
  },
  methods: {
    login(){
      this.axios.post('goods/teacherLogin/',this.form).then(res=>{
        if(res.data.code == 200){
          localStorage.setItem('tuserid',res.data.tid)
          localStorage.setItem('tusername',res.data.tname)
        }
      })
    }
  },
}
</script>

<style scoped>

</style>
